﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using chessLogic;

namespace chessTest
{
    [TestFixture]
    class testFen
    {
        private Board board;
        private Fen fen;
        [SetUp]
        public void SetUp()
        {
            board = new Board();
            board.InitialBoard();
            fen = new Fen();
        }
        [Test]
        public void testCtreateFenDefaultPosition()
        {
            fen.CreateFen(board,FigureColor.White);
            Assert.AreEqual(fen.FenString, "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w");
        }
        [Test]
        public void testCreateFenNotDefaultPosition()
        {
            board.setFigure(new Position("e2"), new None());
            board.setFigure(new Position("e3"), new Pawn(FigureColor.White));
            board.setFigure(new Position("d5"), new Queen(FigureColor.Black));
            fen.CreateFen(board, FigureColor.Black);
            Assert.AreEqual(fen.FenString, "rnbqkbnr/pppppppp/8/3q4/8/4P3/PPPP1PPP/RNBQKBNR b");
        }
    }
}
